$(function () {
    changeName();
    function changeName() {
        $.ajax({
            url: "/users/session",
            type: "post",
            dataType: "json",
            success: function (data) {
                if (data.session!=null){
                    $("#index_name").text(data.session);
                }else {
                    window.location.reload();
                    alert(data.msg)
                }

            }
        });
    }
});
